package com.zjz.controller;


import com.zjz.domain.Book;
import com.zjz.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("/book")

public class BookController {
    @Autowired
    BookService service;

    @RequestMapping("/findAll")
    @ResponseBody
   public List<Book> method(){
        List<Book> list = service.findAll();

        return list;
    }
    @RequestMapping("/update")
    public int  Update(@RequestBody Book book){
        int i = service.update(book);
        return i;
    }

}
